<?php include "templates/include/header.php" ?>

      <div id="adminHeader">
        <h2>Administration des partenaires</h2>
        <p>Vous etes connect&eacute; en tant que <b><?php echo htmlspecialchars( $_SESSION['username']) ?></b>. <a href="admin.php?action=logout"?>Se D&eacute;connecter</a></p>
      </div>

      <h1><?php echo htmlspecialchars( $results['pageTitle'] )?></h1>

      <form id="Upload" name="upload" enctype="multipart/form-data" action="admin.php?action=<?php echo $results['formAction']?>" method="post">
        <input type="hidden" name="sponsorId" value="<?php echo $results['edit']->id ?>"/>

<?php if ( isset( $results['errorMessage'] ) ) { ?>
        <div class="errorMessage"><?php echo $results['errorMessage'] ?></div>
<?php } ?>
  <table align="center" width="90%" cellpadding="5px" cellspacing="0" border="0">
    <tr>
      <td valign="middle" style="margin:0;padding:0" align="left">
        <label for="image">Image :</label>
        <input id="file" type="file" name="file" maxlength="255" value="<?php echo htmlspecialchars( $results['edit']->image )?>"/>
        <img src="<?php echo htmlspecialchars( $results['edit']->image ); ?>"/>
      </td>
      <td valign="middle" align="middle">
        <label for="name">Nom du partenaire :</label>
        <input name="name" id="name" placeholder="Nom du partenaire" maxlength="255" value="<?php echo htmlspecialchars( $results['edit']->name )?>"/>
      </td>
      <td valign="middle" align="middle">
        <label for="url">Lien vers leur site :</label>
        <input name="url" id="url" placeholder="URL vers leur site" maxlength="255" value="<?php echo htmlspecialchars( $results['edit']->url )?>"/>
      </td>
    </tr>
  </table>
        <div class="buttons">
          <input type="submit" name="upload" value="Enregister" />
          <input type="submit" formnovalidate name="cancel" value="Annuler" />
        </div>

      </form>

<?php if ( $results['edit']->id ) { ?>
      <p><a href="admin.php?action=deleteSponsor&amp;sponsorId=<?php echo $results['edit']->id ?>" onclick="return confirm('Delete This Article?')">Supprimer cet Article</a></p>
<?php } ?>

<?php include "templates/include/footer.php" ?>
